import random
import time
from clonesimplte import Clone

SUBTREE = "/client/"


def main():
    clone = Clone()
    clone.subtree = SUBTREE.encode()
    clone.connect("tcp://localhost", 5556)
    clone.connect("tcp://localhost", 5566)

    try:
        while True:
            key = (SUBTREE + "%d" % random.randint(1,10000)).encode('utf-8')
            value = b"%d" % random.randint(1, 1000000)
            clone.set(key, value, random.randint(0, 30))
            time.sleep(1)
    except KeyboardInterrupt:
        pass


if __name__ == '__main__':
    main()
